<%+header%>
<style type="text/css">
.linktype{color:#0069d6; text-decoration:none;}
.linktype:visited{color:#0069d6; text-decoration:none;}
.linktype:hover{color:#0069d6; text-decoration:none;}
.title2{font-size:20px;}
</style>
<script>  //general function
	function getValue(ID)
	{
		return document.getElementById(ID).value;
	}
	function setValue(ID,val){
		document.getElementById(ID).value=val;	
	}
	function setDisplay(ID,type)
	{
		if(!type)
		{
			document.getElementById(ID).style.display="none";
		}
		else
		{
			document.getElementById(ID).style.display="inline";
		}
	}
	function setHTML(ID,STR)
	{
		document.getElementById(ID).innerHTML=STR;
	}
	
</script>
<script>//init	
var buttonStart="<%:start%>";
var buttonStop="<%:stop%>";

function wificamouflage(val){
	
		 if(buttonStart == val){
		     val="start";	
		 }else if(buttonStop == val){
		     val="stop";	
		 }
		 
        var callPath='<%=luci.dispatcher.build_url("admin/wifiscan/APCamouflageAct")%>';
        callPath=callPath+'/'+val;
        XHR.get(callPath,null,function(x,rval){
	
	   	       switch(rval[0])
	   	       { 
	   	       	   case "runing":
	   	           case "stop":
	   	               setValue("ID_INPUT_Fake",buttonStop);
	   	           break;	
	   	           case "unruning":
	   	           case "start":
	   	               setValue("ID_INPUT_Fake",buttonStart);
	   	           break;
	   	           default:
	   	               alert("lua action is err!");
	   	           break;
	   	       }
		     }
	   );
}    
 
//var URLParam=new Array();    
function init()
{
	//URLParam=receive();
	ActStat("status");
}    
</script>
<h2><a id="content" name="content"><%:Upload File%></a></h2>
<fieldset>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
    <div class="cbi-section-node">
    	<div class="cbi-value cbi-value-last">
    		
    		<div class="cbi-value-field">
    			<input type="file" name="archive" id="archive" />
    			<input type="submit" class="cbi-button cbi-input-apply" name="uploadfile" value="<%:Upload%>..." />
    			<input type="button" class="cbi-button" id="ID_INPUT_Fake" onclick="wificamouflage(this.value)" value="<%:start%>">
    		</div>
    	</div>
    </div>	
</form>	
<script>init();</script>
</fieldset>

<%+footer%>